package com.itheima.controller;

import com.itheima.Service.EmpService;
import com.itheima.pojo.Emp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class HelloController {


    @Autowired
    private EmpService empService;

    @GetMapping("/user/{id}")
    public Emp hello(@PathVariable("id") int id){
        System.out.println(id);
        Emp emp = empService.queryById(id);

        return emp;
    }
}
